<?
 class Latest_registered extends Widget
{
	function __construct()
	{
		parent::__construct();
	}
	
	public function defaults()
	{
		$config['name'] = 'Latest registered';
		$config['show_limit'] = 10;
		$config['view_to_public'] = FALSE;
		return $config;			
	}
    function run($id) 
	{
        $this->init_db($id);		
		$data['users'] = $this->db
							->from('users')
							->order_by('created', 'asc')
							->limit($this->data('show_limit'))
							->get()->result_array();
		$data = array_merge($data, $this->data);
		return $this->render('latest_registered', $data);
    }
}  